package com.example.myapplication8;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity2 extends JavaBase {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        EdgeToEdge.enable(this);
     setContentView(R.layout.activity_main2);
//        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
//            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
//            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
//            return insets;
//        });
        Intent intent =getIntent();
        String msg=intent.getStringExtra("ms");
        Toast.makeText(this,msg,Toast.LENGTH_LONG).show();
       Button btn6= findViewById(R.id.btn6);
       btn6.setOnClickListener(new View.OnClickListener(){

           @Override
           public void onClick(View view) {
               //隐式意图方式
               Uri uri = Uri.parse("geo:39.9,116.3");
               Intent intent = new Intent(Intent.ACTION_VIEW, uri);
               startActivity(intent);

           }
       });
       Button tv5 =findViewById(R.id.tv5);
       tv5.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View view) {
               //隐式意图方式
               Uri t1 =Uri.parse("46641");
               Intent intent1 =new Intent(Intent.ACTION_SENDTO,t1);
               intent1.putExtra("sd","zad");
               startActivity(intent1);
               Uri uri =Uri.parse("1233");
               Intent intent=new Intent(Intent.ACTION_CALL,uri);
               startActivity(intent);
           }
       });
        Button tv6 = findViewById(R.id.tv6);



}}